<template>
  <div>
    <el-container>
      <!--        侧边栏-->
      <el-aside :width="asideWidth">
        <div style="height: 60px; line-height: 60px; font-size: 20px; display: flex; align-items: center; justify-content: center">
          <img src="@/assets/logo2.png" style="width: 30px;" alt="">
          <span class="logo-title" v-show="!isCollapse">在线阅卷系统</span>
        </div>
        <el-menu :router='true' :collapse="isCollapse" :collapse-transition="false" background-color="#001529"
                 active-text-color="#fff" text-color="rgba(255, 255, 255, 0.65)" :default-active="$route.path"
                 style="border: none" @select="handleMenuSelect">
          <el-menu-item index="/index">
            <i class="el-icon-s-home"></i>
            <span slot="title">系统首页</span>
          </el-menu-item>
          <el-submenu index="2">
            <template slot="title"><i class="el-icon-menu"></i><span>信息管理</span></template>
            <el-menu-item index="/index/teacherMessage">教师个人信息管理</el-menu-item>
            <el-menu-item index="/index/paperMessage">试卷信息管理</el-menu-item>
            <el-menu-item index="/index/createExam">新建考试阅卷任务</el-menu-item>

          </el-submenu>
          <el-submenu index="2">
            <template slot="title"><i class="el-icon-menu"></i><span>试卷管理</span></template>
            <el-menu-item index="/index/taskList">教师阅卷</el-menu-item>
            <el-menu-item index="/index/scores">学生成绩查询</el-menu-item>
            <el-menu-item index="/index/echarts">学生成绩分析</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>

      <el-container>
<!--        头部区域-->
        <el-header style="height: 60px; line-height: 60px; display: flex; align-items: center; box-shadow: 2px 0 6px rgba(0, 21, 41, .35);">
          <i :class="collapseIcon" @click="handleCollapse" style="font-size: 26px"></i>
          <el-breadcrumb separator="/" style="margin-left: 20px">
            <el-breadcrumb-item >首页</el-breadcrumb-item>
            <el-breadcrumb-item >学生成绩查询</el-breadcrumb-item>
          </el-breadcrumb>

          <div style="flex: 1; display: flex; justify-content: flex-end; align-items: center">
            <i class="el-icon-quanping" @click="handleFullScreen" style="font-size: 25px"></i>
            <el-dropdown placement="bottom">
              <div style="display: flex; align-items: center; cursor: pointer">
                <img src="@/assets/logo2.png" alt="" style="width: 40px; height: 40px; margin: 0 5px">
                <span>教师</span>
              </div>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>个人信息</el-dropdown-item>
                <el-dropdown-item>修改密码</el-dropdown-item>
                <el-dropdown-item>退出登录</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
        </el-header>
<!--        主体区域-->
        <el-main>
          <router-view></router-view>
<!--          <div style="box-shadow: 0 0 10px rgba(0,0,0,.1); padding: 10px 20px; border-radius: 5px; margin-bottom: 10px">-->
<!--            老师您好，请尽快完成您的阅卷任务！-->
<!--          </div>-->
<!--          <div class="demo-image">-->
<!--            <div class="block" v-for="fit in fits" :key="fit">-->
<!--              <span class="demonstration">{{ fit }}</span>-->
<!--              <el-image-->
<!--                  style="width: 100px; height: 100px"-->
<!--                  :src="url"-->
<!--                  :fit="fit"></el-image>-->
<!--            </div>-->
<!--          </div>-->
<!--          <el-page-header @click="goBack" content="阅卷详情页面" >-->
<!--          </el-page-header>-->


<!--          <el-card>-->
<!--            <el-table :data="tableData" border :header-cell-class-name="{background: 'aliceblue',fontSize:'16px'}">-->
<!--              <el-table-column label="序号" prop="id" align="center"></el-table-column>-->
<!--              <el-table-column label="试卷编号" prop="name" align="center"></el-table-column>-->
<!--              <el-table-column label="科目" prop="age" align="center"></el-table-column>-->
<!--              <el-table-column label="分数" prop="address" align="center"></el-table-column>-->
<!--              <el-table-column label="操作" >-->
<!--                <template v-slot="scope">-->
<!--                  <el-button type="primary" @click="edit(scope.row)" >编辑</el-button>-->
<!--                  <el-button type="danger" @click="edit(scope.row)" >删除</el-button>-->
<!--                </template>-->
<!--              </el-table-column>-->
<!--            </el-table>-->
<!--            <div slot="header" class="clearfix">-->
<!--              <el-button type="primary">新增待评阅试卷</el-button>-->
<!--            </div>-->
<!--            <div>-->
<!--              2024毕设正式开始了！青哥哥带你手把手敲出来！-->
<!--              <div style="margin-top: 20px">-->
<!--                <div style="margin: 10px 0"><strong>主题色</strong></div>-->
<!--                <el-button type="primary">按钮</el-button>-->
<!--                <el-button type="success">按钮</el-button>-->
<!--                <el-button type="warning">按钮</el-button>-->
<!--                <el-button type="danger">按钮</el-button>-->
<!--                <el-button type="info">按钮</el-button>-->
<!--              </div>-->
<!--            </div>-->

<!--          </el-card>-->
<!--          <div class="block">-->
<!--            <span class="demonstration"></span>-->
<!--            <el-pagination-->
<!--                layout="prev, pager, next"-->
<!--                :total="50">-->
<!--            </el-pagination>-->
<!--          </div>-->

<!--                    <el-table stripe :header-cell-style="{ backgroundColor: 'aliceblue', fontWeight: 'bold', color: '#333' }">-->
<!--                      <el-table-column label="姓名" align="center"></el-table-column>-->
<!--                      <el-table-column label="电话" align="center"></el-table-column>-->
<!--                      <el-table-column label="邮箱" align="center"></el-table-column>-->
<!--                      <el-table-column label="地址" align="center"></el-table-column>-->
<!--                    </el-table>-->
        </el-main>
<!--        <div style="box-shadow: 0 0 10px rgba(0,0,0,.1); padding: 10px 20px; border-radius: 5px; margin-bottom: 10px">-->
<!--          <el-button type="primary" @click="create()" >创建新的阅卷任务</el-button>-->
<!--        </div>-->
      </el-container>
    </el-container>

  </div>
</template>

<script>

export default {
  name: 'HomeView',
  data() {
    return {
      isCollapse: false,
      asideWidth: '200px',
      collapseIcon: 'el-icon-s-fold',
      tableData:[
        {name:'2051690383',address:' ',id:1,age:'数学'},
        {name:'2051690464',address:'73',id:2,age:'数学'},
        {name:'2051690486',address:'84',id:3,age:'数学'},
        {name:'2051690256',address:'81',id:2,age:'数学'},
        {name:'2051690320',address:'',id:5,age:'数学'},
      ],
      fits: ['fill', 'contain', 'cover', 'none', 'scale-down'],
      url: '../assets/logo2.png'
    }
  },
  mounted() {

  },
  methods: {
    handleMenuSelect(index) {
      const targetPath = '/' + index;

      // 判断目标路径是否与当前路径相同
      // 通过 this.$route.path 获取到当前路由的路径
      if (this.$route.path === targetPath) {
        // 如果相同则不进行导航
        return;
      }

      // 否则进行导航
      this.$router.push({path: targetPath})
    },

    handleFullScreen(){
      document.documentElement.requestFullscreen()
    },
    handleCollapse(){
      this.isCollapse = !this.isCollapse
      this.asideWidth = this.isCollapse ? '64px' : '200px'
      this.collapseIcon = this.isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'
    },
    edit(row){
      this.$message.success('感谢您的辛勤付出，即将跳转阅卷页面')
      // this.$message.success(row.name)
      // this.$message.warning(row.name)
    },
    create(){

    },
    goBack() {
      console.log('go back');
    },
  }
}
</script>

<style>
.el-menu--inline, .el-menu-item {
  background-color: #000c17 !important;
}

.el-submenu__title {
  height: 40px !important;
  line-height: 40px !important;
  padding: 0 25px !important;
  transition: color 0s;
}
.el-menu--collapse .el-submenu__title {
  padding: 0 20px !important;
}
.el-submenu__title>i:nth-child(1) {
  margin-top: 2px;
}
.el-submenu__title>i.el-submenu__icon-arrow {
  margin-top: -5px;
}
.el-menu-item {
  min-width: 0 !important;
  width: calc(100% - 10px);
  margin: 5px;
  height: 40px !important;
  line-height: 40px !important;
  border-radius: 5px;
}
.el-menu--inline>.el-menu-item {
  padding-left: 50px !important;
}
.el-menu-item.is-active {
  background-color: dodgerblue !important;
}

.el-menu-item:hover {
  color: #fff !important;
}

.el-submenu__title:hover *, .el-submenu__title:hover {
  color: #fff !important;
}

.el-aside {
  box-shadow: 2px 0 6px rgba(0, 21, 41, .35);
  background-color: #001529;
  color: #fff;
  min-height: 100vh;
  transition: width .3s;
}
.el-menu--collapse .el-tooltip {
  padding: 0 15px !important;
}
.logo-title {
  margin-left: 5px;
  transition: all .3s;
}
.el-menu {
  transition: all .3s;
}
.el-row {
  margin-bottom: 20px;
}
.el-col {
  border-radius: 4px;
}
.bg-purple-dark {
  background: #99a9bf;
}
.bg-purple {
  background: #d3dce6;
}
.bg-purple-light {
  background: #e5e9f2;
}
.grid-content {
  border-radius: 4px;
  min-height: 36px;
}
.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
</style>
